import request from '@/utils/request'
// 申请人受理 API接口
const apl_applicant_Api = {
  list: '/apl_applicant/list',
  getApplicantWithGroup: '/apl_applicant/getApplicantWithGroup',
  getApplicantByApplyid: '/apl_applicant/getApplicantByApplyid',
  getApplicantAndAgent: '/getApplicantAndAgent/searchByName',
  deleteAttachId: '/apl_applicant/deleteAttachId',
  updateAttachId: '/apl_applicant/updateAttachId', // 更新附件id
  getApplicantAndThirdList: '/apl_applicant/getApplicantAndThirdList',
  saveApplicant: '/apl_applicant/save'
}

/**
 * getApplicantAndAgent
 * @param {*} parameter
 */
export function getApplicantAndAgent (applyid) {
  return request({
    url: apl_applicant_Api.getApplicantAndAgent,
    method: 'post',
    params: {
      applyid
    }
  })
}

/**
 * 查看申请人数据
 * @param {*} body
 */
export function getApplicantlist (body) {
  return request({
    url: apl_applicant_Api.list,
    method: 'post',
    data: body
  })
}

/**
 * 查看申请人数据
 * @param {*} parameter
 */
export function getApplicantWithGroup (parameter) {
  return request({
    url: apl_applicant_Api.getApplicantWithGroup,
    method: 'post',
    params: parameter
  })
}

/**
 *  查看申请人数据
 * @param {*} parameter
 * @returns
 */
export function getApplicantByApplyid (parameter) {
  return request({
    url: apl_applicant_Api.getApplicantByApplyid,
    method: 'post',
    params: parameter
  })
}

/**
 *  删除附件id
 * @param {*} parameter
 * @returns
 */
export function deleteApplicantFile (parameter) {
  return request({
    url: apl_applicant_Api.deleteAttachId,
    method: 'post',
    params: parameter
  })
}

/**
 * 更新附件id
 */
export function updateApplicantAttachId (parameter) {
  return request({
      url: apl_applicant_Api.updateAttachId,
      method: 'post',
      params: parameter
  })
}

/**
 * 查询代理人和第三人
 * @param {} applyid
 * @returns
 */
export function getApplicantAndThirdList (applyid) {
  return request({
    url: apl_applicant_Api.getApplicantAndThirdList,
    method: 'post',
    params: {
      applyid: applyid
    }
  })
}

/**
 * 保存申请人
 * @param {} body
 * @returns
 */
export function saveApplicant (body) {
  return request({
      url: apl_applicant_Api.saveApplicant,
      method: 'post',
      data: body
  })
}
